#ifndef _ACCEPTOR_H
#define _ACCEPTOR_H
#include "InetAddress.h"
#include "Socket.h"
class Acceptor
{
public:
    Acceptor(unsigned short port, const string &ip);
    void ready();
    int accept();
    int fd(){return _sock.fd();}

private:
    void setReuseAddr(bool);
    void setReusePort(bool);
    void bind();
    void listen();

private:
    InetAddress _addr;
    Socket _sock;
};

#endif
